//
//  NSRoundView.m
//  MacDevTest
//
//  Created by lbxia on 2020/8/15.
//  Copyright © 2020 com.lbx. All rights reserved.
//

#import "NSRoundView.h"

@implementation NSRoundView

- (void)drawRect:(NSRect)dirtyRect
{
      [super drawRect:dirtyRect];
    
    [NSGraphicsContext saveGraphicsState];

    NSRect rect = [self bounds];
    NSBezierPath *path = [NSBezierPath bezierPathWithRoundedRect:rect xRadius:5 yRadius:5];
    [path addClip];
    
    [[NSColor controlColor] set];
    NSRectFill(dirtyRect);
    
    [NSGraphicsContext restoreGraphicsState];
    
  
}

@end
